Skip to content

[Core] add support for reasoning parser plugins#28075

Merged
DarkLight1337 merged 7 commits intovllm-project:mainfrom
walterbm:allow-reasoning-parser-plugin
Nov 5, 2025
Merged

[Core] add support for reasoning parser plugins#28075
DarkLight1337 merged 7 commits intovllm-project:mainfrom
walterbm:allow-reasoning-parser-plugin

Conversation

@walterbm
Copy link
Copy Markdown
Contributor

@walterbm walterbm commented Nov 4, 2025

Purpose

Allow reasoning parsers to be dynamically loaded through a new --reasoning-parser-plugin flag (following the pattern used by tool parsers & tool parser plugins). This will make it easier for newer other reasoning models (like Cohere models) to experiment and implement reasoning parsers.

Test Plan

vllm serve CohereLabs/command-a-reasoning-08-2025 --reasoning-parser-plugin {path to parser registered as 'example'} --reasoning-parser example

Test Result

Reasoning parser plugin is successfully loaded and used to parse the response

Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Signed-off-by: walter beller-morales <walter.beller.morales@gmail.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 4, 2025

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors.

You ask your reviewers to trigger select CI tests on top of fastcheck CI.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

🚀

@mergify mergify bot added deepseek Related to DeepSeek models frontend qwen Related to Qwen models structured-output v1 labels Nov 4, 2025
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for dynamically loading reasoning parser plugins, following a similar pattern to tool parser plugins. The changes introduce a new --reasoning-parser-plugin flag and the necessary logic to handle plugin loading and parser validation.

My review identifies two main issues. First, the custom argparse.Action for the reasoning parser is dependent on the order of command-line arguments, which can lead to unexpected failures. I've suggested a more robust implementation. Second, there's redundant code in the StructuredOutputManager, including a duplicate variable assignment and unnecessary plugin loading, which I've recommended simplifying. Addressing these points will improve the robustness and maintainability of the new feature.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Signed-off-by: walter beller-morales <walter.beller.morales@gmail.com>
Copy link
Copy Markdown
Collaborator

@chaunceyjiang chaunceyjiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks~

LGTM.

@chaunceyjiang chaunceyjiang added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 5, 2025
@chaunceyjiang
Copy link
Copy Markdown
Collaborator

/cc @aarnphm PTAL,

Copy link
Copy Markdown
Collaborator

@aarnphm aarnphm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed on slack, i will take this into account when doing refactoring.

Signed-off-by: walter beller-morales <walter.beller.morales@gmail.com>
Signed-off-by: walter beller-morales <walter.beller.morales@gmail.com>
Signed-off-by: walter beller-morales <walter.beller.morales@gmail.com>
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Nov 5, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @walterbm.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Nov 5, 2025
Signed-off-by: walter beller-morales <walter.beller.morales@gmail.com>
@mergify mergify bot removed the needs-rebase label Nov 5, 2025
@DarkLight1337 DarkLight1337 merged commit 752ddea into vllm-project:main Nov 5, 2025
54 checks passed
"--reasoning-parser",
# This choice is a special case because it's not static
choices=list(ReasoningParserManager.list_registered()),
# Choices need to be validated after parsing to include plugins
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might have been nicer if choices were changed to metavar so that users using the CLI --help can still see the built in options without the passed value being strictly checked. You could add something like <plugin> so that users know the list in the metavar is not exhaustive.

@walterbm could this be done in a follow up?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hmellor good idea! yes I can do that

ZhengHongming888 pushed a commit to ZhengHongming888/vllm that referenced this pull request Nov 8, 2025
Signed-off-by: walter beller-morales <walter.beller.morales@gmail.com>
devpatelio pushed a commit to SumanthRH/vllm that referenced this pull request Nov 29, 2025
Signed-off-by: walter beller-morales <walter.beller.morales@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepseek Related to DeepSeek models frontend qwen Related to Qwen models ready ONLY add when PR is ready to merge/full CI is needed structured-output v1

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants